package cn.edu.zxj.order.service.controller;

import cn.edu.zxj.order.service.api.ProductApi;
import cn.edu.zxj.productapi.model.ProductInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description：
 *
 * @author: zxj
 * @date: 2024-10-01
 * @time: 00:47:25
 */
@RestController
@Slf4j
@RequestMapping("/feign")
public class FeignController {
    @Autowired
    private ProductApi productApi;

    @RequestMapping("/o1")
    public String getProductInfoByFeign(Integer test) {
        log.info("order 接收到请求, test:{}", test);
        return productApi.getProductInfoByFeign(test);
    }

    @RequestMapping("/o2")
    public String getProductInfoByFeign(Integer p1, String p2) {
        log.info("order 接收到请求, p1:{}, p2:{}", p1, p2);
        return productApi.getProductInfoByFeign(p1, p2);
    }
    @RequestMapping("/o3")
    public String p3(ProductInfo productInfo) {
        log.info("order 接收到请求, productInfo:{}", productInfo);
        return productApi.p3(productInfo);
    }

    @RequestMapping("/o4")
    public String p4(@RequestBody ProductInfo productInfo) {
        log.info("order 接收到请求, productInfo:{}", productInfo);
        return productApi.p4(productInfo);
    }

}
